<template>
    <div>
        <input type="text" placeholder="请输入内容，按回车键确认" class="contents" v-model="keyword" @keyup.enter="add">
    </div>
</template>

<script>
export default {


    data() {
        return {
            keyword: ''
        };
    },

    mounted() {

    },

    methods: {
        add() {
            this.$emit('add', this.keyword)
            this.keyword = ''
        }
    },
};
</script>

<style lang="scss" scoped>
    .contents {
    width: 300px;
    height: 30px;
    outline: none;
    margin-left: 40px;
}
</style>